//
//  THJMyOrderCell.m
//  THJXHW
//
//  Created by 河南德艺 on 2017/11/22.
//  Copyright © 2017年 河南德艺. All rights reserved.
//

#import "THJMyOrderCell.h"
#import "RSA.h"

@implementation THJMyOrderCell
{
    NSString * statusName;
    NSInteger btnIndex;
    NSString * itemid;
    NSString * allPay;
    NSString * partPay;
    NSString * jdPay;
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
-(void)layoutSubviews{
    self.btn1.layer.borderWidth = 1;
    self.btn1.layer.borderColor = THJOrgColor.CGColor;
    self.btn2.layer.borderWidth = 1;
    self.btn2.layer.borderColor = THJOrgColor.CGColor;
    self.btn3.layer.borderWidth = 1;
    self.btn3.layer.borderColor = THJOrgColor.CGColor;
    self.btn4.layer.borderWidth = 1;
    self.btn4.layer.borderColor = THJOrgColor.CGColor;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(void)setCellContentWithDic:(NSDictionary*)dic btnIndex:(NSInteger)index{
    
    statusName =  [RSA decryptString:dic[@"status"] publicKey:RSA_PubKey];
    btnIndex = index;
    allPay = [RSA decryptString:dic[@"all_pay"] publicKey:RSA_PubKey];
    jdPay = [RSA decryptString:dic[@"jd_pay"] publicKey:RSA_PubKey];
    partPay = [RSA decryptString:dic[@"part_pay"] publicKey:RSA_PubKey];
    itemid = [RSA decryptString:dic[@"itemid"] publicKey:RSA_PubKey];
    NSString * company = [RSA decryptString:dic[@"company"] publicKey:RSA_PubKey];
    self.companyNameLab.text = company;
    NSString * title = [RSA decryptString:dic[@"title"] publicKey:RSA_PubKey];
    self.huoNameLab.text = title;
    NSString * number = [RSA decryptString:dic[@"number"] publicKey:RSA_PubKey];
    self.orderLab.text = number;
    NSString * amount = [RSA decryptString:dic[@"amount"] publicKey:RSA_PubKey];
    self.priceLab2.text = [NSString stringWithFormat:@"%@",amount];
    NSString * name = [RSA decryptString:dic[@"price"] publicKey:RSA_PubKey];
    self.huoNameLab.text = name;
    NSString * time = [RSA decryptString:dic[@"addtime"] publicKey:RSA_PubKey];
    self.huoNameLab.text = [NSString stringWithFormat:@"时间:%@",time];
    NSString * orderid = [RSA decryptString:dic[@"itemid"] publicKey:RSA_PubKey];
    self.orderLab.text = [NSString stringWithFormat:@"订单号:%@",orderid];
    NSString * price = [RSA decryptString:dic[@"price"] publicKey:RSA_PubKey];
    self.priceLab.text = [NSString stringWithFormat:@"%@/吨",price];
    NSString * imgUrl = [RSA decryptString:dic[@"thumb"] publicKey:RSA_PubKey];
    [self.imgV sd_setImageWithURL:[NSURL URLWithString:imgUrl] placeholderImage:kGetImage(@"gongsibiaozhi")];
}
- (IBAction)btn1Action:(id)sender {
   
        NSLog(@"btnindex==%@",statusName);
        [self.delegate statusName1:statusName itemid:itemid all:allPay part:partPay jd:jdPay];
    
}
- (IBAction)btn2Action:(id)sender {
        NSLog(@"btnindex==%@",statusName);
        [self.delegate statusName2:statusName itemid:itemid all:allPay part:partPay jd:jdPay];
  
}
- (IBAction)btn3Action:(id)sender {
   
        NSLog(@"btnindex==%@",statusName);
        [self.delegate statusName3:statusName itemid:itemid];
}
- (IBAction)btn4Action:(id)sender {
  
        NSLog(@"btnindex==%@",statusName);
        [self.delegate statusName4:statusName itemid:itemid];
    
}

@end
